# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'newBaseWindow.ui'
#
# Created: Fri Dec 14 15:11:33 2007
#      by: PyQt4 UI code generator 4.3.1
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
from code import InteractiveInterpreter as Interpreter
import shell

# Importing resources
import icons_rc

class Ui_MainWindow(object):
    def setupUi(self, MainWindow, varsDict):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setWindowIcon(QtGui.QIcon(":/logos/appLogos/icons/mainLogo.png"))
        MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,738,610).size()).expandedTo(MainWindow.minimumSizeHint()))

        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.hboxlayout = QtGui.QHBoxLayout(self.centralwidget)
        self.hboxlayout.setObjectName("hboxlayout")

        self.splitter_2 = QtGui.QSplitter(self.centralwidget)
        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
        self.splitter_2.setObjectName("splitter_2")

        self.listView = QtGui.QListView(self.splitter_2)
        listSizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum,QtGui.QSizePolicy.Expanding)
        self.listView.setModelColumn(0)
        self.listView.setObjectName("listView")
        self.listView.setSizePolicy(listSizePolicy)
        self.listView.setMaximumWidth(200)

        self.splitter = QtGui.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName("splitter")

        self.tableWidget = QtGui.QTableWidget(self.splitter)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tableWidget.sizePolicy().hasHeightForWidth())
        self.tableWidget.setSizePolicy(sizePolicy)
        self.tableWidget.setMinimumSize(QtCore.QSize(350,0))
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setAcceptDrops(True)#BHC ADD
        self.tableWidget.setDragEnabled(True)#BHC ADD

        interpreter = Interpreter(varsDict)
        shellClass = shell.get_shell_class()
        
        self.shell = shellClass(interpreter,parent=self.splitter)
        self.shell.setObjectName("shell")

        self.hboxlayout.addWidget(self.splitter_2)
        MainWindow.setCentralWidget(self.centralwidget)

        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0,0,738,21))
        self.menubar.setObjectName("menubar")
   
        self.menu_File = QtGui.QMenu(self.menubar)
        self.menu_File.setObjectName("menu_File")

        self.menu_Help = QtGui.QMenu(self.menubar)
        self.menu_Help.setObjectName("menu_Help")

        self.menu_Tools = QtGui.QMenu(self.menubar)
        self.menu_Tools.setObjectName("menu_Tools")

        self.menuTable_Actions = QtGui.QMenu(self.menu_Tools)
        self.menuTable_Actions.setObjectName("menuTable_Actions")
        
        self.menuCode_Actions = QtGui.QMenu(self.menu_Tools)
        self.menuCode_Actions.setObjectName("menuCode_Actions")
        
        MainWindow.setMenuBar(self.menubar)

        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.toolBar = QtGui.QToolBar(MainWindow)
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea,self.toolBar)

        self.action_About = QtGui.QAction(MainWindow)
        self.action_About.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/about.png"))
        self.action_About.setObjectName("action_About")

        self.action_New = QtGui.QAction(MainWindow)
        self.action_New.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/newFile.png"))
        self.action_New.setObjectName("action_New")

        self.action_Open = QtGui.QAction(MainWindow)
        self.action_Open.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/openData.png"))
        self.action_Open.setObjectName("action_Open")

        self.action_Save = QtGui.QAction(MainWindow)
        self.action_Save.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/saveData.png"))
        self.action_Save.setObjectName("action_Save")

        self.actionSave_as = QtGui.QAction(MainWindow)
        self.actionSave_as.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/saveData.png"))
        self.actionSave_as.setObjectName("actionSave_as")
        
        self.actionQuit = QtGui.QAction(MainWindow)
        self.actionQuit.setIcon(QtGui.QIcon(":/icons/menuIcons/icons/quitApp.png"))
        self.actionQuit.setObjectName("actionQuit")

        self.action_Get_selection = QtGui.QAction(MainWindow)
        self.action_Get_selection.setIcon(QtGui.QIcon(":/icons/toolbarIcons/icons/getTableSelection.png"))
        self.action_Get_selection.setObjectName("action_Get_selection")

        self.actionClear_table = QtGui.QAction(MainWindow)
        self.actionClear_table.setIcon(QtGui.QIcon(":/icons/toolbarIcons/icons/clearTable.png"))
        self.actionClear_table.setObjectName("actionClear_table")
        
        self.actionExecute_script = QtGui.QAction(MainWindow)
        self.actionExecute_script.setIcon(QtGui.QIcon(":/icons/toolbarIcons/icons/openScript.png"))
        self.actionExecute_script.setObjectName("actionExecute_script")

        # Adding actions to menus
        self.menu_File.addAction(self.action_New)
        self.menu_File.addAction(self.action_Open)
        self.menu_File.addAction(self.action_Save)
        self.menu_File.addAction(self.actionSave_as)
        self.menu_File.addAction(self.actionQuit)
        self.menu_Help.addAction(self.action_About)
        self.menuTable_Actions.addAction(self.action_Get_selection)
        self.menuTable_Actions.addAction(self.actionClear_table)
        self.menuCode_Actions.addAction(self.actionExecute_script)
        self.menu_Tools.addAction(self.menuTable_Actions.menuAction())
        self.menu_Tools.addAction(self.menuCode_Actions.menuAction())
        self.menubar.addAction(self.menu_File.menuAction())
        self.menubar.addAction(self.menu_Tools.menuAction())
        self.menubar.addAction(self.menu_Help.menuAction())
        
        # Adding actions to toolbar
        self.toolBar.addAction(self.action_New)
        self.toolBar.addAction(self.action_Open)
        self.toolBar.addAction(self.action_Save)
        self.toolBar.addSeparator()
        self.toolBar.addAction(self.action_Get_selection)
        self.toolBar.addAction(self.actionClear_table)
        self.toolBar.addSeparator()
        self.toolBar.addAction(self.actionExecute_script)

        self.retranslateUi(MainWindow)
        #QtCore.QObject.connect(self.actionClear_table,QtCore.SIGNAL("triggered()"),self.tableWidget.clear)
        QtCore.QObject.connect(self.actionQuit,QtCore.SIGNAL("triggered()"),MainWindow.close)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "PQ Sheet", None, QtGui.QApplication.UnicodeUTF8))
        self.listView.setStatusTip(QtGui.QApplication.translate("MainWindow", "List of variables", None, QtGui.QApplication.UnicodeUTF8))
        self.tableWidget.setStatusTip(QtGui.QApplication.translate("MainWindow", "Importer", None, QtGui.QApplication.UnicodeUTF8))
        self.tableWidget.setRowCount(500)
        self.tableWidget.setColumnCount(100)
        self.tableWidget.clear()
        self.tableWidget.setColumnCount(100)
        self.tableWidget.setRowCount(500)
        self.shell.setStatusTip(QtGui.QApplication.translate("MainWindow", "Shell", None, QtGui.QApplication.UnicodeUTF8))
        self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
        self.menu_Help.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8))
        self.menu_Tools.setTitle(QtGui.QApplication.translate("MainWindow", "&Tools", None, QtGui.QApplication.UnicodeUTF8))
        self.menuTable_Actions.setTitle(QtGui.QApplication.translate("MainWindow", "Table Actions", None, QtGui.QApplication.UnicodeUTF8))
        self.menuCode_Actions.setTitle(QtGui.QApplication.translate("MainWindow", "Code Actions", None, QtGui.QApplication.UnicodeUTF8))
        self.toolBar.setWindowTitle(QtGui.QApplication.translate("MainWindow", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
        self.action_About.setText(QtGui.QApplication.translate("MainWindow", "&About", None, QtGui.QApplication.UnicodeUTF8))
        self.action_New.setText(QtGui.QApplication.translate("MainWindow", "&New/Close", None, QtGui.QApplication.UnicodeUTF8))
        self.action_Open.setText(QtGui.QApplication.translate("MainWindow", "&Open", None, QtGui.QApplication.UnicodeUTF8))
        self.action_Save.setText(QtGui.QApplication.translate("MainWindow", "&Save", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_as.setText(QtGui.QApplication.translate("MainWindow", "Save &as", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "&Quit", None, QtGui.QApplication.UnicodeUTF8))
        self.action_Get_selection.setText(QtGui.QApplication.translate("MainWindow", "&Get selection", None, QtGui.QApplication.UnicodeUTF8))
        self.actionClear_table.setText(QtGui.QApplication.translate("MainWindow", "Clear &table", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExecute_script.setText(QtGui.QApplication.translate("MainWindow", "E&xecute script", None, QtGui.QApplication.UnicodeUTF8))
        
        

if __name__ == "__main__":
    import sys
    app = QtGui.QApplication(sys.argv)
    MainWindow = QtGui.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())
